<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>树组件</title>
    <link rel="stylesheet" href="../../style/layui-v2.5.6/layui/css/layui.css">
</head>
<style>
    h1{
        text-align: center;
    }
</style>
<body style="background: #FBFBFB">
    <h1>系统菜单页面--树结构</h1>
    <div id="test1"></div>


    <script src="../../style/layui-v2.5.6/layui/layui.js"></script>
    <script type="text/javascript" src ="../../style/js/jquery-3.3.1.js"></script>
    <script>
        layui.use('tree', function(){
            var tree = layui.tree;
            $.ajax({
                type:"post",
                url:"../../Menu/selMenu.do",
                data:{"pid":0},
                dataType:"json",
                success:function (json){
                    //渲染
                    var inst1 = tree.render({
                        elem: '#test1'  //绑定元素
                        ,edit: ['add', 'update', 'del']
                        ,showCheckbox:'true'
                        ,data: json.data
                    });
                }
            })

        });

    </script>
</body>
</html>
